<template>
    <div class="commission-msg">
        <div class="message-detail">
            <div class="detail-list">
                <span>佣金：</span>
                <span>{{msg.commission}}</span>
            </div>
            <div class="detail-list">
                <span>二级分销人员：</span>
                <span>{{msg.nickname}}</span>
            </div>
            <div class="detail-list">
                <span>支付金额：</span>
                <span>￥{{msg['pay_money']}}</span>
            </div>
            <div class="detail-list">
                <span>总金额：</span>
                <span>￥{{msg['total_money']}}</span>
            </div>
            <div class="detail-list">
                <span>商品：</span>
                <span>{{msg['goods_name']}} {{msg.price}}元*{{msg['number']}}</span>
            </div>
            <div class="detail-list">
                <span>成交时间：</span>
                <span>{{msg['pay_time']}}</span>
            </div>
        </div>
        <div class="contact-us">
            <span>对此订单有疑惑，请联系客服！</span>
            <span>400-400-4000</span>
        </div>
    </div>
</template>

<script>
export default {
    name:'commissionMsg',
    data(){
        return {
            msg:{}
        }
    },
    methods:{
        getMsgDetail(){
            let that = this;
            let token = localStorage.getItem('token');
            let id = this.$route.query.id;
            let loader = that.loading();
            that.$ajax(that, 'get', that.$api.commissionMsg+id, null, token, function(res){
                if(res.data['error_code'] == 0){
                    that.msg = res.data['msg'];
                }else{
                    that.toast(res.data['msg']);
                }
                loader.close();
            })
        }
    },
    mounted(){
        // console.log(this.$route);
        this.$store.state.tab = '佣金详情';
        this.getMsgDetail();
    },
    activated(){
        this.$store.state.tab = '佣金详情';
        this.getMsgDetail();
    }
}
</script>

<style lang='less'>
@rem:100rem;

.commission-msg{
    margin-top: 88/@rem;
    width: 750/@rem;
    padding-top: 20/@rem;
    .detail-list{
        width: 100%;
        height: 80/@rem;
        background: #ffffff;
        padding: 0 20/@rem;
        text-align: start;
        line-height: 80/@rem;
        border-bottom: 1px solid #e8e8e8;
    }
    .detail-list:nth-of-type(3){
        color: #ff7171;
    }
    .contact-us{
        width: 550/@rem;
        height: 140/@rem;
        margin: 0 auto;
        background-color: #ffffff;
        border-radius: 10/@rem;
        border: solid 1px #bcbcbc;
        margin-top: 100/@rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        span:nth-of-type(1){
            color: #ff7171;
            margin-bottom: 10/@rem;
        }
    }
}
</style>
